window.onload = function () {
    var map = new BMap.Map("container");
    /*var opts = {
        width : 50,     // 信息窗口宽度
        height: 20,     // 信息窗口高度
        title : ""  // 信息窗口标题
    };
    var infoWindow = new BMap.InfoWindow("东华（安徽）规划院有限公司", opts);  // 创建信息窗口对象
    map.openInfoWindow(infoWindow, map.getCenter());  */    // 打开信息窗口

    var x, y;
    if (navigator.geolocation) {
        // document.getElementById("status").innerHTML = "HTML5 Geolocation is supported in your browser.";
        // 百度地图API功能
        var point = new BMap.Point(x, y);
        map.centerAndZoom(point, 8);
        var geolocation = new BMap.Geolocation();
        geolocation.getCurrentPosition(function (r) {
            if (this.getStatus() === BMAP_STATUS_SUCCESS) {
                var mk = new BMap.Marker(r.point);
                map.addOverlay(mk);
                map.panTo(r.point);
            }
            else {
                alert('failed' + this.getStatus());
            }
        }, {enableHighAccuracy: true});
    }

    map.enableScrollWheelZoom();                 //启用滚轮放大缩小
};